import request from '@/utils/request'


const apiUrl = '/api/personnel-change'
// 获取人事异动分页列表
export function getPersonnelChangePage(current, size, searchForm = {}) {
    return request({
        url: `${apiUrl}/page`,
        method: 'get',
        params: {
            current,
            size,
            monthValue: searchForm.monthValue,
            docNumber: searchForm.docNumber,
            reviewer: searchForm.reviewer,
            approver: searchForm.approver
        }
    })
}

// 根据ID获取人事异动详情
export function getPersonnelChangeById(id) {
    return request({
        url: `${apiUrl}/${id}`,
        method: 'get'
    })
}

// 保存或更新人事异动
export function savePersonnelChange(data) {
    return request({
        url: `${apiUrl}/save`,
        method: 'post',
        data
    })
}

// 删除人事异动
export function deletePersonnelChange(id) {
    return request({
        url: `${apiUrl}/${id}`,
        method: 'delete'
    })
} 